package com.gao.autoconfigdemo;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;

/**
 * @author GaoXi
 * @date 2022/3/2 21:07
 */
@Configuration
public class MyController {

    @PostConstruct
    public void post(){
        System.err.println("hello");
    }


    /**
     * @Bean 不一定是在 @Configuration 配置类中
     * @return
     */
    @Bean
    public TestBean testBean(){
        return new TestBean();
    }
}
